Coder Social home page Coder Social logo

cpprandom's Introduction

cpprandom Build Status Documentation

This package provides random number generation for Futhark. It is designed to closely imitate <random>, which is very elaborate, but also very flexible. Another complication is due to Futhark's purity, so it is up to the programmer to explicitly manage the RNG state. You are adviced to read the documentation (which contains examples) before using this package. The tests may also be illuminating.

Installation

$ futhark pkg add github.com/diku-dk/cpprandom
$ futhark pkg sync

Usage

The following shows how to combine the random number engine minstd_rand with the distribution module uniform_int_distribution to simulate a single dice roll (throwing away the new RNG state).

$ futhark repl
> import "lib/github.com/diku-dk/cpprandom/random"
> let rng = minstd_rand.rng_from_seed [123]
> module d = uniform_int_distribution i32 minstd_rand
> (d.rand (1,6) rng).2
1

Compatibility

The versioning guarantees for this package do not necessarily involve full replicability. The random sequences may change, even without bumping the major version number, if necessary to fix bugs in seeding or to improve operations such as split_rng.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.