This is an early attempt at wrapping the pcg random number generator for use in Python and Numpy. It uses source from pcg, numpy and randomkit.
Currently only some core RNGs are available: uniform [0,1), standard normal, standard gamma, standard exponential and 32-bit unsigned integers.
The generators all return 1-d arrays.
Alternative streams can be generated by setting the initial state and increment
when initialize the object, or when using seed
.
The advance function has been implemented, see advance
.
There is no documentation.
There are still many improvements needed before this is really usable.
At a minimum this needs to support:
- More critical RNGs
- Ability to return other shapes
- Default arguments
- Entropy based initialization
Requires (Built Using):
- Numpy (1.10)
- Cython (0.23)
So far all development has been on Linux, so other platforms might not work.
So far I have only experimented with in-place building.
cd pcg
python setup.py build_ext --inplace
import pcg
rs = pcg.PCGRandomState()
rs.standard_normal(100)
Standard NCSA, plus sub licenses for components.