3
3
[ ![ Travis Build Status] ( https://travis-ci.org/bashtage/ng-numpy-randomstate.svg?branch=master )] ( https://travis-ci.org/bashtage/ng-numpy-randomstate )
4
4
[ ![ Appveyor Build Status] ( https://ci.appveyor.com/api/projects/status/odc5c4ukhru5xicl/branch/master?svg=true )] ( https://ci.appveyor.com/project/bashtage/ng-numpy-randomstate/branch/master )
5
5
6
- This is a library and generic interface for alternative random generators
7
- in Python and Numpy.
6
+ This is a library and generic interface for alternative random
7
+ generators in Python and Numpy.
8
8
9
9
## Features
10
10
@@ -30,22 +30,19 @@ import randomstate as rnd
30
30
w = rnd.standard_normal(10000 , method = ' zig' )
31
31
```
32
32
33
- * Preliminary support for 32-bit floating randoms for core generators.
34
- Currently only uniforms (` random_sample ` ), exponentials
35
- (` standard_exponential ` ) and normals (` standard_normal ` but only
36
- using Box-Muller, so ` method='bm' ` is required) have been implemented.
37
- Ultimately support should be avialable for:
38
-
39
- * Uniforms
40
- * Exponentials
41
- * Standard Gammas (via ` standard_gamma ` )
42
- * Normals (currently only implemented using Box-Muller transformation)
33
+ * Support for 32-bit floating randoms for core generators.
34
+ Currently supported:
35
+
36
+ * Uniforms (` random_sample ` )
37
+ * Exponentials (` standard_exponential ` )
38
+ * Normals (` standard_normal ` , both Box-Muller and Ziggurat)
39
+ * Standard Gammas (via ` standard_gamma ` )
43
40
44
41
** WARNING** : The 32-bit generators are ** experimental** and subjust
45
42
to change.
46
43
47
- ** Note** : There are no plans to extend the alternative precision generation to
48
- all random number types.
44
+ ** Note** : There are _ no _ plans to extend the alternative precision
45
+ generation to all random number types.
49
46
50
47
51
48
@@ -59,11 +56,14 @@ The RNGs include:
59
56
60
57
* [ MT19937] ( https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/ ) ,
61
58
the NumPy rng
62
- * [ dSFMT] ( http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/ ) a SSE2-aware
63
- version of the MT19937 generator that is especially fast at generating doubles
64
- * [ xorshift128+] ( http://xorshift.di.unimi.it/ ) , [ xoroshiro128+] ( http://xoroshiro.di.unimi.it/ )
65
- [ xorshift1024* ] ( http://xorshift.di.unimi.it/ )
66
- * [ PCG32] ( http://www.pcg-random.org/ ) and [ PCG64] ( http:w//www.pcg-random.org/ )
59
+ * [ dSFMT] ( http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/ ) a
60
+ SSE2-aware version of the MT19937 generator that is especially fast at
61
+ generating doubles
62
+ * [ xorshift128+] ( http://xorshift.di.unimi.it/ ) ,
63
+ [ xoroshiro128+] ( http://xoroshiro.di.unimi.it/ ) and
64
+ [ xorshift1024* ] ( http://xorshift.di.unimi.it/ )
65
+ * [ PCG32] ( http://www.pcg-random.org/ ) and
66
+ [ PCG64] ( http:w//www.pcg-random.org/ )
67
67
* [ MRG32K3A] ( http://simul.iro.umontreal.ca/rng )
68
68
* A multiplicative lagged fibonacci generator (LFG(63, 1279, 861, * ))
69
69
@@ -75,8 +75,8 @@ support an additional `method` keyword argument which can be `bm` or
75
75
` zig ` where ` bm ` corresponds to the current method using the Box-Muller
76
76
transformation and ` zig ` uses the much faster (100%+) ziggurat method.
77
77
* ` random_sample ` can produce either single precision (` np.float32 ` ) or
78
- double precision (` np.float64 ` , the default) using an the optional keyword
79
- argument ` dtype ` .
78
+ double precision (` np.float64 ` , the default) using an the optional
79
+ keyword argument ` dtype ` .
80
80
81
81
### New Functions
82
82
@@ -93,9 +93,9 @@ the RNG._
93
93
94
94
## Status
95
95
96
- * Complete drop-in replacement for ` numpy.random.RandomState ` . The ` mt19937 `
97
- generator is identical to ` numpy.random.RandomState ` , and will produce an
98
- identical sequence of random numbers for a given seed.
96
+ * Complete drop-in replacement for ` numpy.random.RandomState ` . The
97
+ ` mt19937 ` generator is identical to ` numpy.random.RandomState ` , and
98
+ will produce an identical sequence of random numbers for a given seed.
99
99
* Builds and passes all tests on:
100
100
* Linux 32/64 bit, Python 2.7, 3.4, 3.5 (should work on 2.6 and 3.3)
101
101
* PC-BSD (FreeBSD) 64-bit, Python 2.7
@@ -133,13 +133,16 @@ Testing requires nose (1.3+).
133
133
** Note:** it might work with other versions but only tested with these
134
134
versions.
135
135
136
+ ## Development and Testing
137
+
136
138
All development has been on 64-bit Linux, and it is regularly tested on
137
- Travis-CI. The library is occasionally tested on Linux 32-bit, OSX 10.10,
138
- PC-BSD 10.2 (should also work on Free BSD) and Windows (Python 2.7/3.5,
139
- both 32 and 64-bit).
139
+ Travis-CI. The library is occasionally tested on Linux 32-bit,
140
+ OSX 10.10, PC-BSD 10.2 (should also work on Free BSD) and Windows
141
+ (Python 2.7/3.5, both 32 and 64-bit).
140
142
141
- Basic tests are in place for all RNGs. The MT19937 is tested against NumPy's
142
- implementation for identical results. It also passes NumPy's test suite.
143
+ Basic tests are in place for all RNGs. The MT19937 is tested against
144
+ NumPy's implementation for identical results. It also passes NumPy's
145
+ test suite.
143
146
144
147
## Installing
145
148
@@ -179,8 +182,8 @@ rs = randomstate.prng.mt19937.RandomState()
179
182
rs.random_sample(100 )
180
183
```
181
184
182
- Like NumPy, ` randomstate ` also exposes a single instance of the ` mt19937 `
183
- generator directly at the module level so that commands like
185
+ Like NumPy, ` randomstate ` also exposes a single instance of the
186
+ ` mt19937 ` generator directly at the module level so that commands like
184
187
185
188
``` python
186
189
import randomstate
@@ -194,7 +197,8 @@ will work.
194
197
Standard NCSA, plus sub licenses for components.
195
198
196
199
## Performance
197
- Performance is promising, and even the mt19937 seems to be faster than NumPy's mt19937.
200
+ Performance is promising, and even the mt19937 seems to be faster than
201
+ NumPy's mt19937.
198
202
199
203
```
200
204
Speed-up relative to NumPy (Uniform Doubles)
0 commit comments