Skip to content

rkern/pcg-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pcg-python

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.

Status

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.

Plans

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

Requirements

Requires (Built Using):

  • Numpy (1.10)
  • Cython (0.23)

So far all development has been on Linux, so other platforms might not work.

Building

So far I have only experimented with in-place building.

cd pcg
python setup.py build_ext --inplace

Using

import pcg

rs = pcg.PCGRandomState()
rs.standard_normal(100)

License

Standard NCSA, plus sub licenses for components.

About

Wrapper for pcg random number generator for use in Python and Numpy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.9%
  • Python 5.1%