File tree 1 file changed +10
-4
lines changed
lib/node_modules/@stdlib/random/base/improved-ziggurat/lib
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ function factory( options ) {
72
72
var randn ;
73
73
var state ;
74
74
var seed ;
75
+ var copy ;
75
76
if ( arguments . length ) {
76
77
if ( ! isObject ( options ) ) {
77
78
throw new TypeError ( 'invalid argument. Must provide an object. Value: `' + options + '`.' ) ;
@@ -102,26 +103,31 @@ function factory( options ) {
102
103
}
103
104
}
104
105
}
106
+ copy = ( options && options . copy === false ) ? options . copy : true ;
105
107
if ( state === void 0 ) {
106
108
if ( randu === void 0 ) {
107
109
if ( seed === void 0 ) {
108
- randi = mt19937 ( ) ;
110
+ randi = mt19937 ( {
111
+ 'copy' : copy
112
+ } ) ;
109
113
} else {
110
114
randi = mt19937 ( {
111
- 'seed' : seed
115
+ 'seed' : seed ,
116
+ 'copy' : copy
112
117
} ) ;
113
118
}
114
119
randu = randi . normalized ;
115
120
} else {
116
121
randi = mt19937 ( {
117
- 'seed' : floor ( 1.0 + ( UINT32_MAX * randu ( ) ) ) // allows seeding via an externally seeded PRNG
122
+ 'seed' : floor ( 1.0 + ( UINT32_MAX * randu ( ) ) ) , // allows seeding via an externally seeded PRNG
123
+ 'copy' : copy
118
124
} ) ;
119
125
seed = null ;
120
126
}
121
127
} else {
122
128
randi = mt19937 ( {
123
129
'state' : state ,
124
- 'copy' : ( options . copy === void 0 ) ? true : options . copy
130
+ 'copy' : copy
125
131
} ) ;
126
132
randu = randi . normalized ;
127
133
}
You can’t perform that action at this time.
0 commit comments