Giter Club home page Giter Club logo

pcg-cpp-wrap's Introduction

PCG Random Number Generation, C++ Edition

This code provides an implementation of the PCG family of random number generators, which are fast, statistically excellent, and offer a number of useful features.

Full details can be found at the PCG-Random website. This version of the code provides many family members -- if you just want one simple generator, you may prefer the minimal C version of the library.

There are two kinds of generator, normal generators and extended generators. Extended generators provide k dimensional equidistribution and can perform party tricks, but generally speaking most people only need the normal generators.

There are two ways to access the generators, using a convenience typedef or by using the underlying templates directly (similar to C++11's std::mt19937 typedef vs its std::mersenne_twister_engine template). For most users, the convenience typedef is what you want, and probably you're fine with pcg32 for 32-bit numbers. If you want 64-bit numbers, either use pcg64 (or, if you're on a 32-bit system, making 64 bits from two calls to pcg32_k2 may be faster).

Documentation and Examples

Visit PCG-Random website for information on how to use this library, or look at the sample code in the sample directory -- hopefully it should be fairly self explanatory.

Building

The code is written in C++11, as an include-only library (i.e., there is nothing you need to build). There are some provided demo programs and tests however. On a Unix-style system (e.g., Linux, Mac OS X) you should be able to just type

make

To build the demo programs.

Testing

Run

make test

Directory Structure

The directories are arranged as follows:

  • include -- contains pcg_random.hpp and supporting include files
  • test-high -- test code for the high-level API where the functions have shorter, less scary-looking names.
  • sample -- sample code, some similar to the code in test-high but more human readable, some other examples too

pcg-cpp-wrap's People

Contributors

adam4130 avatar bhickey avatar crepererum avatar felixonmars avatar imneme avatar ismail avatar merwaaan avatar nejci avatar neumann-a avatar o11c avatar ph4r05 avatar shawnw avatar tido64 avatar

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.