|
| 1 | +""" |
| 2 | +randomstate contains implements NumPy-like RandomState objects with an |
| 3 | +enhanced feature set. |
| 4 | +
|
| 5 | +This modules includes a number of alternative random number generators |
| 6 | +in addition to the MT19937 that is included in NumPy. The RNGs include: |
| 7 | +
|
| 8 | +- `MT19937 <https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/>`__, |
| 9 | + the NumPy rng |
| 10 | +- `dSFMT <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/>`__ a |
| 11 | + SSE2-aware version of the MT19937 generator that is especially fast |
| 12 | + at generating doubles |
| 13 | +- `SFMT <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/>`__ a |
| 14 | + SSE2-aware version of the MT19937 generator that is optimized for |
| 15 | + integer values |
| 16 | +- `xorshift128+ <http://xorshift.di.unimi.it/>`__, |
| 17 | + `xoroshiro128+ <http://xoroshiro.di.unimi.it/>`__ and |
| 18 | + `xorshift1024\* <http://xorshift.di.unimi.it/>`__ |
| 19 | +- `PCG32 <http://www.pcg-random.org/>`__ and |
| 20 | + `PCG64 <http:w//www.pcg-random.org/>`__ |
| 21 | +- `MRG32K3A <http://simul.iro.umontreal.ca/rng>`__ |
| 22 | +- A multiplicative lagged fibonacci generator (LFG(63, 1279, 861, \*)) |
| 23 | +
|
| 24 | +Help is available at `on github <https://bashtage.github.io/ng-numpy-randomstate>`_. |
| 25 | +
|
| 26 | +New Features |
| 27 | +------------ |
| 28 | +
|
| 29 | +- ``standard_normal``, ``normal``, ``randn`` and |
| 30 | + ``multivariate_normal`` all support an additional ``method`` keyword |
| 31 | + argument which can be ``bm`` or ``zig`` where ``bm`` corresponds to |
| 32 | + the current method using the Box-Muller transformation and ``zig`` |
| 33 | + uses the much faster (100%+) Ziggurat method. |
| 34 | +- ``standard_exponential`` and ``standard_gamma`` both support an |
| 35 | + additional ``method`` keyword argument which can be ``inv`` or |
| 36 | + ``zig`` where ``inv`` corresponds to the current method using the |
| 37 | + inverse CDF and ``zig`` uses the much faster (100%+) Ziggurat method. |
| 38 | +- Core random number generators can produce either single precision |
| 39 | + (``np.float32``) or double precision (``np.float64``, the default) |
| 40 | + using an the optional keyword argument ``dtype`` |
| 41 | +- Core random number generators can fill existing arrays using the |
| 42 | + ``out`` keyword argument |
| 43 | +
|
| 44 | +New Functions |
| 45 | +------------- |
| 46 | +
|
| 47 | +- ``random_entropy`` - Read from the system entropy provider, which is |
| 48 | + commonly used in cryptographic applications |
| 49 | +- ``random_raw`` - Direct access to the values produced by the |
| 50 | + underlying PRNG. The range of the values returned depends on the |
| 51 | + specifics of the PRNG implementation. |
| 52 | +- ``random_uintegers`` - unsigned integers, either 32- |
| 53 | + (``[0, 2**32-1]``) or 64-bit (``[0, 2**64-1]``) |
| 54 | +- ``jump`` - Jumps RNGs that support it. ``jump`` moves the state a |
| 55 | + great distance. *Only available if supported by the RNG.* |
| 56 | +- ``advance`` - Advanced the core RNG 'as-if' a number of draws were |
| 57 | + made, without actually drawing the numbers. *Only available if |
| 58 | + supported by the RNG.* |
| 59 | +""" |
1 | 60 | from __future__ import division, absolute_import, print_function
|
2 | 61 |
|
3 | 62 | from randomstate.prng.mt19937 import *
|
|
0 commit comments